package org.shiwen.week11;

public abstract class Human implements Eatable{

}

interface Eatable{
    public abstract void eat();
}

class TestHuman{
    public static void main(String[] args) {
        Human chinese = new Human() {
            @Override
            public void eat() {
                System.out.println("用筷子吃饭");
            }
        };
        Eatable e[] = new Eatable[3];
        e[0] = chinese;
        e[1] = new Eatable() {
            @Override
            public void eat() {
                System.out.println("用刀叉吃饭");
            }
        };
        e[2] = new Eatable() {
            @Override
            public void eat() {
                System.out.println("用手抓饭");
            }
        };
        for (int i = 0; i < e.length; i++) {
            e[i].eat();
        }

    }
}